# Maintainer: Bruno Pagani <archange@archlinux.org>
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Tobias Kieslich <tobias@archlinux.org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Dominik Ryba <domryba@post.pl>

pkgname=hugin
pkgver=2023.0.0
pkgrel=1
pkgdesc="Panorama photo stitcher"
arch=(loong64 x86_64)
url="http://hugin.sourceforge.net/"
license=(GPL)
depends=(boost-libs
         enblend-enfuse
         exiv2
         fftw
         glew
         glu
         lapack
         lcms2
         lensfun
         libjpeg
         libpano13
         libpng
         libtiff
         libxi
         libxmu
         openexr
         python
         sqlite
         vigra
         wxwidgets-gtk3)
makedepends=(boost
             cmake
             mesa
             swig
             tclap)
optdepends=('darktable: RAW import using darktable'
            'dcraw: RAW import using dcraw'
            'perl-image-exiftool: GPano tags support'
            'rawtherapee: RAW import using rawtherapee')
_archive="$pkgname-$pkgver"
source=("https://downloads.sourceforge.net/$pkgname/$_archive.tar.bz2")
sha256sums=('04a39fccc6017e0544c639bd22309472c574d35b3455cbade1fc3870e631632b')

build() {
  cmake -B build -S "$_archive" \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DENABLE_LAPACK=yes \
    -DBUILD_HSI=ON \
    -DUSE_GDKBACKEND_X11=ON
  make -C build
}

package() {
  make -C build DESTDIR="$pkgdir" install
}
